const path = require('path')
module.exports = {
  pluginOptions: { // 第三方插件配置
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, 'src/assets/css/variables.less')] // less所在文件路径
    }
  },
  publicPath: '/myTab/',
  // 避免打包生成.map文件
  productionSourceMap: false,
  devServer: {
    // host: '0.0.0.0',
    hot: true,
    disableHostCheck: true,
    port: '8084',
    overlay: {
      warnings: false,
      errors: true
    },
    proxy: {
      '/chrome-api': {
        // target: 'https://rbac.tophant.com/api',
        // target: 'http://10.0.89.145:30123',
        target: 'http://127.0.0.1:7001',
        pathRewrite: {
          '^/chrome-api': ''
        },
        ws: false,
        changeOrigin: true
      }
    },
    headers: {
      'Access-Control-Allow-Origin': '*'
    }
  },
}